import {isEmpty} from '@/utils/index';
const msgStore = {
	namespaced: true,
	//全局单例，响应式
	state: {
		msgContent:'',
		ascription:'',
		ascriptionPage:'',
		tabBarIndex:0,
		lastFileName:'',
		currentFileName:'',
	},
	//获取状态属性
	getters: {
		getMsgContent(state){
			return state.msgContent;
		}
	},
	//同步修改
	mutations: {
		setMsgContent(state,msgContent){
			state.msgContent = msgContent;
		},
		setAscription(state,payload){
			state.ascription = payload.ascription;
		},
		setAscriptionPage(state,payload){
			state.ascriptionPage = payload.ascriptionPage;
			console.log('ascriptionPage',state.ascriptionPage);
		},
		setTabBarIndex(state,payload){
			state.tabBarIndex = payload.tabBarIndex;
		},
		setFileName(state,names){
			state.lastFileName = names.lastFileName;
			state.currentFileName = names.currentFileName;
			console.log('store  last:',state.lastFileName);
			uni.setStorage({
				key:'currentFileName',
				data:state.currentFileName
			})
		}
	},
	//异步修改：有耗时操作时，调用此模块
	actions: {
		
	}
};
export default msgStore;